import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 配置路由表
const routes = [{
  path: '/',
  component: () => import('@/views/layout'),
  children: [{ path: '', component: () => import('@/views/layout/dashboard') },
    { path: '/homeSeverCo', component: () => import('@/views/layout/homeSeverCo') },
    { path: '/homeStaff', component: () => import('@/views/layout/homeStaff') }
  ]
},
{ path: '/PersonaIinfo', component: () => import('@/views/layout/PersonaIinfo') },
// 首页家政平台跳转路由
{
  path: '/ys:sId', name: 'ys', component: () => import('@/views/layout/dashboard/components/mm-particulars'), props: true
},
// 我的关注
// {
//   path: '/myatt', component: () => import('@/views/layout/PersonaIinfo/components/attention-co')
// },
// 已联系家政人员
{
  path: '/linkman', component: () => import('@/views/layout/PersonaIinfo/components/linkman')
},
{
  path: '/personalData',
  component: () => import('@/views/layout/PersonaIinfo/personalData')
},
{ // 入驻商务部
  path: '/Settle',
  component: () => import('@/views/layout/dashboard/Settle')
},
{ // 登录
  path: '/login',
  component: () => import('@/views/layout/login')
},
{ path: '/linkman', component: () => import('@/views/layout/PersonaIinfo/components/linkman.vue') },
{ path: '/Housekeeping', component: () => import('@/views/layout/dashboard/components/Housekeeping.vue') },
{ path: '/companyDetails:coId', name: 'companyDetails', component: () => import('@/views/company-details'), props: true },
{ path: '/homeStaff', component: () => import('@/views/layout/homeStaff') },
{ path: '/PersonaIinfo', component: () => import('@/views/layout/PersonaIinfo') },
{ path: '/homeStandard', component: () => import('@/views/homeStandard') },
{ path: '/homeStaffAuthorize', component: () => import('@/views/homeStaffAuthorize') },
{ path: '/aboutus', component: () => import('@/views/aboutus') },
{ path: '/myfollow', component: () => import('@/views/my-Follow') }
]

const router = new VueRouter({
  routes
})

const originalReplace = VueRouter.prototype.replace
VueRouter.prototype.replace = function replace (location) {
  return originalReplace.call(this, location).catch(err => err)
}
export default router
